﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace DAL
{
    public static class GetParValues
    {
        #region Get ParValue
        static testdbsEntities ctx = new testdbsEntities();

        public static List<ParValue> GetParValue()
        {
            
            {
                IQueryable<ParValue> tParValue = from cs in ctx.ParValue
                                                 select cs;
                return tParValue.ToList();
            }
        }

        public static List<ParValue> GetParValueByParametr(Parameters mParams)
        {
            
            {
                IQueryable<ParValue> tParValue = from cs in ctx.ParValue
                                                 where cs.fk_param == mParams.id_param
                                                 select cs;
                return tParValue.ToList();
            }
        }

        public static List<ParValue> GetParValueByFlight(Flight mFlight)
        {
            
            {
                IQueryable<ParValue> tParValue = from cs in ctx.ParValue
                                                 where cs.fp_flight == mFlight.id_flight
                                                 select cs;
                return tParValue.ToList();
            }
        }

        public static List<ParValue> GetParValueByWritetime(TimeSpan mTime)
        {
            
            {
                IQueryable<ParValue> tParValue = from cs in ctx.ParValue
                                                 where cs.wtime == mTime
                                                 select cs;
                return tParValue.ToList();
            }
        }

        public static List<ParValue> GetParValueByID(int mId)
        {
            
            {
                IQueryable<ParValue> tParValue = from cs in ctx.ParValue
                                                 where cs.id == mId
                                                 select cs;
                return tParValue.ToList();
            }
        }
        #endregion
    }
}
